//
//  NITitleLabel.m
//  AIWAYS
//
//  Created by Marx on 2018/6/14.
//  Copyright © 2018年 wlq. All rights reserved.
//

#import "NITitleLabel.h"
#import "FontDefines.h"
#import "ColorDefine.h"

@implementation NITitleLabel

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    [super drawRect:rect];
    // Drawing code
    
    NSString *text = self.text;
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:text attributes:@{NSKernAttributeName:@(1)}];
    
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setParagraphSpacing:10];
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [text length])];
    self.attributedText = attributedString;
    [self setTextColor:NIColorTitleTextColor];
    [self setFont:NIFontTitleFont];
}

@end
